#!/bin/bash

echo 进程开始，正在更新itunes补丁，本脚本仅适用于除12.4.6的手机！

rm -rf ~/.ssh/known_hosts

cd ~/Desktop/SSHPASS

./sshpass -p "alpine" ssh -o StrictHostKeyChecking=no root@localhost -p 1025 mount -o rw,union,update /

./sshpass -p alpine scp -rP 1025 -o StrictHostKeyChecking=no ./bypass2 root@localhost:/usr/libexec/bypass2

./sshpass -p alpine scp -rP 1025 -o StrictHostKeyChecking=no ./com.iro.mobileact.plist root@localhost:/usr/libexec/com.iro.mobileact.plist

./sshpass -p alpine scp -rP 1025 -o StrictHostKeyChecking=no ./mobileact root@localhost:/usr/libexec/mobileact

./sshpass -p "alpine" ssh -o StrictHostKeyChecking=no root@localhost -p 1025 mv /usr/libexec/mobileactivationd /usr/libexec/mobileactivationdbak

./sshpass -p "alpine" ssh -o StrictHostKeyChecking=no root@localhost -p 1025 mv /usr/libexec/com.iro.mobileact.plist /System/Library/LaunchDaemons/com.iro.mobileact.plist

./sshpass -p "alpine" ssh -o StrictHostKeyChecking=no root@localhost -p 1025 mv /usr/libexec/com.iro.mobileact.plist /Library/LaunchDaemons/com.iro.mobileact.plist

./sshpass -p "alpine" ssh -o StrictHostKeyChecking=no root@localhost -p 1025 mv /usr/libexec/mobileact /etc/mobileactmv

./sshpass -p "alpine" ssh -o StrictHostKeyChecking=no root@localhost -p 1025 mv /usr/libexec/bypass2 /usr/libexec/mobileactivationd

./sshpass -p "alpine" ssh -o StrictHostKeyChecking=no root@localhost -p 1025 chmod 755 /usr/libexec/mobileactivationd

./sshpass -p "alpine" ssh -o StrictHostKeyChecking=no root@localhost -p 1025 launchctl unload /System/Library/LaunchDaemons/com.apple.mobileactivationd.plist

echo 文件发送成功！请等待部署过程完成！

./sshpass -p "alpine" ssh -o StrictHostKeyChecking=no root@localhost -p 1025 launchctl load /System/Library/LaunchDaemons/com.apple.mobileactivationd.plist

echo 绕过完毕，请重连电脑即可安装爱思助手，enjoy！
